//
//  AppAction.swift
//  PokeMaster
//
//  Created by 李腾芳 on 2022/1/11.
//  Copyright © 2022 OneV's Den. All rights reserved.
//

import Foundation
import SwiftUI

enum AppAction {
    case home(Home)
    case settings(Settings)
}

extension AppAction {
    enum Settings {
        case login(email: String, password: String)
        case accountBehaviorDone(result: Result<User, AppError>)
        case logout
        case emailValid(Bool)
        case registerEnable(Bool)
        case accountRegister(email: String, password: String)
        case accountRegisterDone(result: Result<Void, AppError>)
        case clearCache
    }
    
    enum Home {
        case loadPokeMenList
        case loadPokeMenListDone(result: Result<[PokemonViewModel], AppError>)
        case expandPokemonRow(id: Int)
        case showPokemonPanel(model: PokemonViewModel)
    }
}
